package com.codedancer.campus.manager.api.dynamic;

import com.codedancer.campus.common.anno.InterfacePermission;
import com.codedancer.campus.common.core.BaseApi;
import com.codedancer.campus.common.response.ApiResponse;
import com.codedancer.campus.manager.service.vo.dynamic.DynamicExamineRecordVo;
import com.codedancer.campus.manager.service.IDynamicExamineRecordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/dynamic-examine-record")
@CrossOrigin(methods = {RequestMethod.GET, RequestMethod.POST, RequestMethod.DELETE,
    RequestMethod.PUT}, maxAge = 3600)
@Api(value = "动态审核记录Api", description = "动态审核记录Api", tags = "动态审核记录Api")
public class DynamicExamineRecordApi extends BaseApi {

    @Autowired
    private IDynamicExamineRecordService dynamicExamineRecordService;

    @GetMapping("/list/{dynamicUuid}")
    @ApiOperation("查询某个动态的审核记录")
    @InterfacePermission(encodes = {"superAdmin","treeHoleAdmin"})
    public ApiResponse<List<DynamicExamineRecordVo>> list(
        @PathVariable(value = "dynamicUuid", required = true) @ApiParam(value = "动态uuid", required = true) String dynamicUuid) {
        return success(dynamicExamineRecordService.list(dynamicUuid));
    }
}
